import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export function getList() {
  return request({
    url: baseUrl + '/api/forms/getforms',
    method: 'get'
  })
}

export function condition(page, limit, params) {
  return request({
    url: baseUrl + '/api/forms/getcondition',
    method: 'get',
    params: {
      key:params.name==undefined?'':params.name,
      type:params.typeCode==undefined?'':params.typeCode,
      page,
      limit
    }
  })
}

export function add(data) {
  return request({
    url: baseUrl + '/api/forms/addCond',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: baseUrl + '/api/forms/editCond',
    method: 'post',
    data
  })
}

export function remove(ids) {
  return request({
    url: baseUrl + '/api/forms/deleteCond',
    method: 'post',
    params: {ids}
  })
}

